var http = require('./require.js')
// 获取工单列表
function GetOrderList(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrder/GetWxOrderList',
        'method': 'post',
        'data': data
    })
}
function GetListAudit(data) {
  if (!data) {
      data = {}
  }
  return http.Request({
      'url': '/kf/api/WorkOrder/GetListAudit',
      'method': 'post',
      'data': data
  })
}
// 获取各状态工单数量 -- 首页
function GetOrderStatusCount(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrder/GetWxOrderStatusCount',
        'method': 'post',
        'data': data
    })
}
// 获取各状态工单数量 --我的
function GetWxMyOrderCount(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrder/GetWxMyOrderCount',
        'method': 'post',
        'data': data
    })
}

function GetWxOrderStatusCount(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrder/GetWxOrderStatusCount',
        'method': 'post',
        'data': data
    })
}
// 获取工单详情
function GetOrderDetail(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrder/GetOrderDetail',
        'method': 'post',
        'data': data
    })
}
// 接收工单
function ReceiveOrder(orderId) {
    return http.Request({
        'url': '/kf/api/WXRecord/ReceiveOrder?orderId=' + orderId,
        'method': 'post'
    })
}
// 工单流程
function UpdateOrderProcedure(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrderProcedure/Update',
        'method': 'post',
        'data': data
    })
}
// 工单审核（测温类）
function Examine(data) {
  if (!data) {
      data = {}
  }
  return http.Request({
      'url': '/kf/api/WorkOrderTempInfo/Exam',
      'method': 'post',
      'data': data
  })
}
// 工单地址列表
function GetOrderAddressList(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrder/GetOrderAddressList',
        'method': 'post',
        'data': data
    })
}
// 工单排行
function GetOrderReport(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrder/GetOrderReport',
        'method': 'post',
        'data': data
    })
}

function Login(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/api/SystemMoule/Account/login',
        'method': 'post',
        'data': data
    })
}

function WxLogin(openId) {
    return http.Request({
        'url': '/api/SystemMoule/Account/WxLogin?appName=order&openId=' + openId,
        'method': 'post'
    })
}

function WxAuthCode(code) {
    return http.Request({
        'url': '/api/SystemMoule/Account/WxAuthCode?appName=order&code=' + code,
        'method': 'post'
    })
}

function WxUnBind(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/api/SystemMoule/Account/WxUnBind?appName=order',
        'method': 'post',
        'data': data
    })
}

function WxBind(data) {
    return http.Request({
        'url': '/api/SystemMoule/Account/WxBind?appName=order&openId=' + data.openId + '&username=' + data.username + '&password=' + data.password,
        'method': 'post',
        'data': data
    })
}

function GetInfo() {
    return http.Request({
        'url': '/api/SystemMoule/PSysUser/UserInfo',
        'method': 'get'
    })
}

function Logout() {
    return http.Request({
        'url': '/api/SystemMoule/Account/LoginOut',
        'method': 'get'
    })
}

function UpdatePwd(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/api/SystemMoule/PSysUser/UpdatePwd',
        'method': 'post',
        'data': data
    })
}

function GetWorkOperTotal(data) {
    if (!data) {
        data = {}
    }
    return http.Request({
        'url': '/kf/api/WorkOrder/GetWorkOperTotalList',
        'method': 'post',
        'data': data
    })
}
// 获取标准代码
function GetPCode(data) {
    return http.Request({
        'url': '/api/SystemMoule/PCode/GetPCode',
        'method': 'get',
        'data': data
    })
}
function GetPCodes(data) {
  return http.Request({
      'url': '/api/SystemMoule/PCode/GetPCode_S',
      'method': 'post',
      'data': data
  })
}
function GetPCodeList(data) {
  return http.Request({
      'url': '/api/SystemMoule/PCode/List',
      'method': 'post',
      'data': data
  })
}
function GetComplainCount(data) {
  return http.Request({
      'url': '/kf/api/WorkOrderTempInfo/GetComplainCount',
      'method': 'post',
      'data': data
  })
}
// 发送通知
function SendMsg(data) {
  return http.Request({
      'url': '/api/SystemMoule/PMsgSend/SendMsg',
      'method': 'post',
      'data': data
  })
}
// 获取通知
function GetMsgList(data) {
    return http.Request({
        'url': '/api/SystemMoule/PMsgSend/GetMsgPageList',
        'method': 'get',
        'data': data
    })
}
// 更改通知状态
function ChangeMsgStatus(data) {
    return http.Request({
        'url': '/api/SystemMoule/PMsgSend/ChangeMsgStatus',
        'method': 'post',
        'data': data
    })
}
// 更改所有通知状态
function ChangeAllStatus(data) {
    return http.Request({
        'url': '/api/SystemMoule/PMsgSend/ChangeAllStatus',
        'method': 'post',
        'data': data
    })
}
// 获取通知详情
function GetNotice(noticeId) {
    return http.Request({
        'url': '/api/SystemMoule/Notice/GetNotice?noticeId=' + noticeId,
        'method': 'get'
    })
}

function GetUser(data) {
    return http.Request({
        'url': '/api/SystemMoule/PSysUser/PSysUserPageList',
        'method': 'get',
        'data': data
    })
}
// 获取维修所树
function GetRepairDeptListTree() {
    return http.Request({
        'url': '/api/SystemMoule/ODept/GetRepairDeptListTree',
        'method': 'get'
    })
}
function GetRepairLogList(data) {
  return http.Request({
      'url': '/wx/api/repair/GetRepairLogList',
      'method': 'post',
      'data': data
  })
}
function AcceptRepair(data) {
  return http.Request({
      'url': '/wx/api/repair/AcceptRepair',
      'method': 'post',
      'data': data
  })
}
function TranspondRepair(data) {
  return http.Request({
      'url': '/wx/api/repair/TranspondRepair',
      'method': 'post',
      'data': data
  })
}
function GetDeptListTree(data) {
  return http.Request({
      'url': '/api/SystemMoule/ODept/GetDeptListTree',
      'method': 'get',
      'data': data
  })
}
function GetDeptUserTree(data) {
  return http.Request({
      'url': '/api/SystemMoule/PSysUser/GetDeptUserTree',
      'method': 'post',
      'data': data
  })
}
function GetUrgency() {
  return http.Request({
      'url': '/kf/api/Urgency/GetList',
      'method': 'post'
  })
}
function GetWxReportOrderCount(data) {
  return http.Request({
      'url': '/kf/api/WorkOrder/GetWxReportOrderCount',
      'method': 'post',
      'data': data
  })
}
function GetWorkOrderType(data) {
  return http.Request({
      'url': '/kf/api/WorkOrderType/GetTreeData',
      'method': 'post',
      'data': data
  })
}
function GetMiniAppMenu(data) {
  return http.Request({
      'url': '/api/SystemMoule/PSysUser/GetMiniAppMenu',
      'method': 'POST',
      'data': data
  })
}
function GetCConsInfo(data) {
  return http.Request({
      'url': '/kf/api/ccons/GetCConsInfo',
      'method': 'POST',
      'data': data
  })
}
function GetList_CC(data) {
  return http.Request({
      'url': '/kf/api/ccons/GetList_CC_NoPage',
      'method': 'POST',
      'data': data
  })
}
function GetSysDeptTree(data) {
  return http.Request({
      'url': '/api/SystemMoule/HeatArea/GetSysDeptTree',
      'method': 'post',
      'data': data
  })
}
function RegisterConsOrder(data) {
  return http.Request({
      'url': '/kf/api/WorkOrder/RegisterConsOrder',
      'method': 'post',
      'data': data
  })
}
function GetCurrentWeather(data) {
  return http.Request({
      'url': '/api/SystemMoule/Weather/GetCurrentWeather',
      'method': 'get',
      'data': data
  })
}
module.exports = {
    GetUser: GetUser,
    GetOrderList: GetOrderList,
    Login: Login,
    Logout: Logout,
    WxLogin: WxLogin,
    WxAuthCode: WxAuthCode,
    WxUnBind: WxUnBind,
    WxBind: WxBind,
    UpdatePwd: UpdatePwd,
    GetInfo: GetInfo,
    GetWorkOperTotal: GetWorkOperTotal,
    GetPCode: GetPCode,
    GetPCodes: GetPCodes,
    GetPCodeList: GetPCodeList,
    SendMsg: SendMsg,
    GetMsgList: GetMsgList,
    ChangeMsgStatus: ChangeMsgStatus,
    ChangeAllStatus: ChangeAllStatus,
    GetNotice: GetNotice,
    GetOrderStatusCount: GetOrderStatusCount,
    GetWxOrderStatusCount: GetWxOrderStatusCount,
    GetOrderDetail: GetOrderDetail,
    UpdateOrderProcedure: UpdateOrderProcedure,
    GetOrderAddressList: GetOrderAddressList,
    GetOrderReport: GetOrderReport,
    GetWxMyOrderCount: GetWxMyOrderCount,
    GetRepairDeptListTree: GetRepairDeptListTree,
    ReceiveOrder: ReceiveOrder,
    GetListAudit: GetListAudit,
    Examine: Examine,
    GetComplainCount: GetComplainCount,
    GetRepairLogList: GetRepairLogList,
    AcceptRepair: AcceptRepair,
    TranspondRepair: TranspondRepair,
    GetDeptListTree: GetDeptListTree,
    GetDeptUserTree: GetDeptUserTree,
    GetUrgency: GetUrgency,
    GetWxReportOrderCount: GetWxReportOrderCount,
    GetWorkOrderType: GetWorkOrderType,
    GetMiniAppMenu: GetMiniAppMenu,
    GetCConsInfo: GetCConsInfo,
    GetList_CC: GetList_CC,
    GetSysDeptTree,
    RegisterConsOrder,
    GetCurrentWeather
}